﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.OleDb;

public partial class Login : System.Web.UI.Page
{
    OleDbDataReader dr;
    protected void Page_Load(object sender, EventArgs e)
    {
        Session.Clear();
    }
    protected void btnSub_Click(object sender, EventArgs e)
    {
        Connectivity con = new Connectivity();
        dr = con.Execute_Reader("select * from LOGIN where USERID='" + txtId.Text + "' and PASSWORD='" + txtPwd.Text + "'");
        if (dr.HasRows)
            {
                Session["id"] = txtId.Text;
                Response.Redirect("AdminHome.aspx");
            }
            else
            {
                Label12.Text = "INVALID USERID/PASSWORD.";
            }
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Response.Redirect("Register.aspx");
    }
    protected void LinkButton2_Click(object sender, EventArgs e)
    {
        Response.Redirect("ForgotPwd.aspx");
    }
}